<extend name="Public/base" />

<block name="body">
    <!-- 标题栏 -->
    <div class="main-title">
        <h2>用户资金</h2>
    </div>
    <div class="cf">
        <span style = "width:180px;display:inline-block">涉及金额：<i style = "color:red">{$showdata[0]['showmoney']}</i> 元</span>
        <!--<div class="fl">-->
            <!--<button class="sch-btn btn" id="search_two" url="{:U('download')}">导出</button>-->
        <!--</div>-->
        <!-- 高级搜索 -->
        <div class="search-form fr cf">
            <div class="sleft">
                <select name="status" id="status">
                    <option value="-2" <if condition="$status eq -2">selected</if>  style="width:200px">操作类型</option>
                    <option value="1" <if condition="$status eq 1">selected</if>  style="width:200px">充值</option>
                    <option value="2" <if condition="$status eq 2">selected</if>  style="width:200px">提现</option>
                    <option value="3" <if condition="$status eq 3">selected</if>  style="width:200px">下单</option>
                    <option value="4" <if condition="$status eq 4">selected</if>  style="width:200px">平仓</option>
                    <option value="5" <if condition="$status eq 5">selected</if>  style="width:200px">盈利</option>
                    <option value="6" <if condition="$status eq 6">selected</if>  style="width:200px">佣金</option>
                    <option value="7" <if condition="$status eq 7">selected</if>  style="width:200px">系统操作</option>
                    <option value="8" <if condition="$status eq 8">selected</if>  style="width:200px">提现返回</option>
                </select>
            </div>
            <div class="sleft">
                <input type="text" name="nickname" class="search-input" value="{:I('nickname')}" placeholder="用户名搜索">
            </div>
            <div class="sleft">
                <input type="text" id="start_time" name="start_time"  class="search-input" value="{:I('start_time')}" placeholder="开始时间">
            </div>
            <div class="sleft">
                <input type="text" id="end_time" name="end_time"  class="search-input" value="{:I('end_time')}" placeholder="结束时间">
            </div>
            <div class="sleft">
                <a class="sch-btn" href="javascript:;" id="search" url="{:U('FuturesAgent/agent_all_money',array('id'=>$id))}"><i class="btn-search"></i></a>
            </div>
        </div>

    </div>
    <!-- 数据列表 -->
    <div class="data-table table-striped">
        <table class="">
            <thead>
            <tr>
                <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
                <th class="">ID</th>
                <th class="">用户名</th>
                <th class="">操作金额</th>
                <th class="">账户余额</th>
                <th class="">操作类型</th>
                <th class="">操作说明</th>
                <!--<th class="">类型</th>-->
                <th class="">创建时间</th>
            </tr>
            </thead>
            <tbody>
            <notempty name="querysql">
                <volist name="querysql" id="vo">
                    <tr>
                        <td><input class="ids" type="checkbox" name="ids[]" value="{$vo.id}" /></td>
                        <td>{$vo.id}</td>
                        <td>{$vo.nickname}</td>
                        <td>{$vo.topmoney}</td>
                        <td>{$vo.balance}</td>
                        <td>{$s_types[$vo['type']]}</td>
                        <td>{$vo.note}</td>
                        <td>{$vo.create_time|time_format}</td>
                        <!--<td>{$vo.type}</td>-->
                    </tr>
                </volist>
                <else/>
                <td colspan="9" class="text-center"> aOh! 暂时还没有内容! </td>
            </notempty>
            </tbody>
        </table>
    </div>
    <div class="page">
        {$show}
    </div>
</block>

<block name="script">
    <link href="__STATIC__/datetimepicker/css/datetimepicker.css?v={:SITE_VERSION}" rel="stylesheet" type="text/css">
    <php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css?v={:SITE_VERSION}" rel="stylesheet" type="text/css">';</php>
    <link href="__STATIC__/datetimepicker/css/dropdown.css?v={:SITE_VERSION}" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js?v={:SITE_VERSION}" charset="UTF-8"></script>
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js?v={:SITE_VERSION}"></script>
    <script type="text/javascript">
        $('#start_time,#end_time,#create_time').datetimepicker({
            format: 'yyyy-mm-dd ',
            language:"zh-CN",
            minView:2,
            autoclose:true,
        });
        //搜索功能
        $("#search").click(function(){
            var url = $(this).attr('url');
            var query  = $('.search-form').find('input').serialize();
            var status=$('#status').val();
            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
            query = query.replace(/^&/g,'');
            query+="&status="+status;

            if( url.indexOf('?')>0 ){
                url += '&' + query;
            }else{
                url += '?' + query;
            }
            //alert(url);
            window.location.href = url;
        });
        //搜索功能
        $("#search_two").click(function(){
            var url = $(this).attr('url');
            var query  = $('.search-form').find('input').serialize();
            var status=$('#status').val();
            var direction=$('#direction').val();
            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
            query = query.replace(/^&/g,'');
            query+="&status="+status;
            query+="&direction="+direction;
            if( url.indexOf('?')>0 ){
                url += '&' + query;
            }else{
                url += '?' + query;
            }
            //alert(url);
            window.location.href = url;
        });
        //回车搜索
        $(".search-input").keyup(function(e){
            if(e.keyCode === 13){
                $("#search").click();
                return false;
            }
        });
        //导航高亮
        $('.side-sub-menu').find('a[href="{:U('FuturesAgent/agent_all_money')}"]').closest('li').addClass('current');
    </script>
</block>
